extends IUsableComponent


class_name SetterComponent
"""
一次性直接使用的效果
"""


## 属性设置
@export var setter: IEventActuator = null


func __check_exports() -> Dictionary:
    return IComponent.merge({
        "setter": IComponent.find_child.bind(self, func(x): return x is IEventActuator, setter),
    }, super.__check_exports())

## 应用效果
func apply(character: CharacterComponent) -> bool:
    if super.apply(character):
        IEventActuator.safe_execute(setter)
        super.cancel()
        return true
    return false
